package com.wyw.quartz.learning.service;

import com.wyw.quartz.learning.entity.JobEntity;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Trigger;

import java.util.List;

/**
 * @Title
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2024/3/29 17:54
 * Update History:
 * Author        Time            Content
 */
public interface DynamicJobService {
    //通过Id获取Job
    JobEntity getJobEntityById(Long id);

    //从数据库中加载获取到的所有Job
    List<JobEntity> loadJobs();

    //获取JobDataMap（Job参数对象）
    JobDataMap getJobDataMap(JobEntity job);

    //获取JobDetail，JobDetail是任务的定义，而Job是任务的执行逻辑，
    JobDetail getJobDetail(JobKey jobKey, String description, JobDataMap map);

    //获取Trigger（Job触发器，执行规则）
    Trigger getTrigger(JobEntity job);

    //获取JobKey，包含Name与Group
    JobKey getJobKey(JobEntity job);
}
